//
//  UIBarButtonItem+Extension.swift
//  swiftweibo6
//
//  Created by ysz on 15/11/28.
//  Copyright © 2015年 user. All rights reserved.
//
import UIKit

extension UIBarButtonItem
{
    convenience init(imageName: String)
    {
        let button = UIButton()
        button.setBackgroundImage(UIImage(named: imageName), forState: UIControlState.Normal)
        button.setBackgroundImage(UIImage(named: "\(imageName)_highlighted"), forState: UIControlState.Highlighted)
        button.sizeToFit()
        
        self.init(customView: button)
        
    }
}
